package edu.sctu.zhengsenwen.month201505.day20150517;

/**
 * Created by user15 on 2015/5/18.
 */
public class TextOne extends TextMore {

    public TextOne(Teacher[] teacher) {
        super(teacher);
    }


    Student[] studentcode1 = new Student[teacher[0].students.length];
    Student[] studentcode2 = new Student[teacher[1].students.length];
    Student[] studentcode3 = new Student[teacher[2].students.length];



    public void getTercherInfo() {
        //输出按工号排序后的老师信息
        sortNumber();
        for (int i = 0; i < teacher.length; i++) {

            System.out.println(teacher[i].name+":"+teacher[i].number+":"+teacher[i].sex);

        }
    }

//    public Student[] getStudent(int code, Student[] student) {
//
//        Student[] studentcode = new Student[student.length];
//
//        int counterNum = 0;
//
//        for (int i = 0; i < student.length; i++) {
//            if (student[i].code > code) {
////                System.out.println("sdghjksgsdhhkdhjdflh");
//                //输出成绩大于code的学生信息
//                studentcode[counterNum] = student[i];
//                counterNum++;
//            }
//
////            System.out.println(code);
//        }
//
//        System.out.println(counterNum);
//
//        Student[] studentcodeReuturn = new Student[counterNum];
//
//        for (int i = 0; i < counterNum; i++) {
//
//            studentcodeReuturn [i] = studentcode [i];
//        }
//
//        return studentcodeReuturn;
//
//    }



    public Student[] getCode(int code, Student[] student) {



        Teacher teacher = pritCoded();

        Student[] studentnumber =interfacestudent.getStudent(62,student);

        return studentnumber;

    }


    InterfaceStudent interfacestudent = new InterfaceStudent() {
        @Override
        public Student[] getStudent(int code,Student[] student) {

            Student[] studentnumber = getStudent(60,student);
            return studentnumber;
        }
    };


    public void  compareStudentsCode(int code,Student[] students){

        Student []student = new Student[students.length];
        int counterNum = 0;

        for (int i = 0; i < students.length; i++) {

            if (code < students[i].code){
                student[counterNum]  = students[i];
                counterNum++;
            }

            Student []returnData = new Student[counterNum];
            for (int j = 0; j < counterNum; j++) {
                returnData[j] = student[j];
            }
        }
    }


}

